/*
 * Cute4jNUnit.h  0.4.0 / Nov 14, 2010
 *
 * Copyright (c) 2010 - 2011, cute4j.com and contributors.
 *
 * This software is licensed under the LGPL version 2.1 license.
 * A copy of this license is included in the file LICENSE-LGPL.txt.
 */
#ifndef CUTE4JNUNIT_H
#define CUTE4JNUNIT_H

#ifdef CUTE4J_TEST

/*!
 * \brief Common header file for the test module.
 *
 * \author Slobodan Vrkacevic
 * \version 0.4.0
 */

// Cute4jNUnit :: Includes. ----------------------------------------------------

#include "NativeTestRegistry.h"
#include "NativeTestCase.h"

// Cute4jNUnit :: Macro Definitions. -------------------------------------------

#define TEST_ASSERT(condition) \
    do { \
      if (!(condition)) { \
        failCondition(#condition, __FILE__, __LINE__); \
        return; \
      } \
    } while (false)
#define TEST_ASSERT_EQUALS(obj1, obj2) \
    do { \
      if (!(obj1 == obj2)) { \
        failCondition(#obj1" == "#obj2, __FILE__, __LINE__); \
        return; \
      } \
    } while (false)

#define REGISTER_NATIVE_TEST(module, class) \
    static bool registred = NativeTestRegistry:: \
              registerTestFactory(#module, new NativeTestFactory<class>(#class))

#endif // CUTE4J_TEST

#endif // CUTE4JNUNIT_H

